package com.kingdee.eas.custom.rcbudget.ekingwin.www.esb.QMYX_SUNAC_363_easBrokerageBillApprove;

import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.Remote;
import java.util.HashSet;
import java.util.Iterator;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceException;
import org.apache.axis.AxisFault;
import org.apache.axis.EngineConfiguration;
import org.apache.axis.client.Service;
import org.apache.axis.client.Stub;

public class QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSServiceLocator extends Service
  implements QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSService
{
  private String QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPort_address = "http://192.168.2.219:8002/WP_SUNAC/APP_EAS_SERVICES/Proxy_Services/TA_QMYX/EAS_SUNAC_363_easBrokerageBillApprove_PS";

  private String QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPortWSDDServiceName = "QMYX_SUNAC_363_easBrokerageBillApprove_ptt-bindingQSPort";

  private HashSet ports = null;

  public QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSServiceLocator()
  {
  }

  public QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSServiceLocator(EngineConfiguration config)
  {
    super(config);
  }

  public QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSServiceLocator(String wsdlLoc, QName sName) throws ServiceException {
    super(wsdlLoc, sName);
  }

  public String getQMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPortAddress()
  {
    return this.QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPort_address;
  }

  public String getQMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPortWSDDServiceName()
  {
    return this.QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPortWSDDServiceName;
  }

  public void setQMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPortWSDDServiceName(String name) {
    this.QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPortWSDDServiceName = name;
  }

  public QMYX_SUNAC_363_easBrokerageBillApprove_ptt getQMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPort() throws ServiceException
  {
    try {
      endpoint = new URL(this.QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPort_address);
    }
    catch (MalformedURLException e)
    {
      URL endpoint;
      throw new ServiceException(e);
    }
    URL endpoint;
    return getQMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPort(endpoint);
  }

  public QMYX_SUNAC_363_easBrokerageBillApprove_ptt getQMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPort(URL portAddress) throws ServiceException {
    try {
      QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingStub _stub = new QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingStub(portAddress, this);
      _stub.setPortName(getQMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPortWSDDServiceName());
      return _stub;
    } catch (AxisFault e) {
    }
    return null;
  }

  public void setQMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPortEndpointAddress(String address)
  {
    this.QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPort_address = address;
  }

  public Remote getPort(Class serviceEndpointInterface)
    throws ServiceException
  {
    try
    {
      if (QMYX_SUNAC_363_easBrokerageBillApprove_ptt.class.isAssignableFrom(serviceEndpointInterface)) {
        QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingStub _stub = new QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingStub(new URL(this.QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPort_address), this);
        _stub.setPortName(getQMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPortWSDDServiceName());
        return _stub;
      }
    }
    catch (Throwable t) {
      throw new ServiceException(t);
    }
    throw new ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
  }

  public Remote getPort(QName portName, Class serviceEndpointInterface)
    throws ServiceException
  {
    if (portName == null) {
      return getPort(serviceEndpointInterface);
    }
    String inputPortName = portName.getLocalPart();
    if ("QMYX_SUNAC_363_easBrokerageBillApprove_ptt-bindingQSPort".equals(inputPortName)) {
      return getQMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPort();
    }

    Remote _stub = getPort(serviceEndpointInterface);
    ((Stub)_stub).setPortName(portName);
    return _stub;
  }

  public QName getServiceName()
  {
    return new QName("http://www.ekingwin.com/esb/QMYX_SUNAC_363_easBrokerageBillApprove", "QMYX_SUNAC_363_easBrokerageBillApprove_ptt-bindingQSService");
  }

  public Iterator getPorts()
  {
    if (this.ports == null) {
      this.ports = new HashSet();
      this.ports.add(new QName("http://www.ekingwin.com/esb/QMYX_SUNAC_363_easBrokerageBillApprove", "QMYX_SUNAC_363_easBrokerageBillApprove_ptt-bindingQSPort"));
    }
    return this.ports.iterator();
  }

  public void setEndpointAddress(String portName, String address)
    throws ServiceException
  {
    if ("QMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPort".equals(portName)) {
      setQMYX_SUNAC_363_easBrokerageBillApprove_pttBindingQSPortEndpointAddress(address);
    }
    else
    {
      throw new ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
    }
  }

  public void setEndpointAddress(QName portName, String address)
    throws ServiceException
  {
    setEndpointAddress(portName.getLocalPart(), address);
  }
}